//
//  UIButton+Extension.swift
//  大波微博swift
//
//  Created by 大波 on 16/3/5.
//  Copyright © 2016年 zhaojin. All rights reserved.
//

import UIKit

extension UIButton {
    
    convenience init(bgImageName: String = "timeline_card_bottom_background", imageName: String, title: String, font: CGFloat = 11) {
        
        self.init()
        
        setBackgroundImage(UIImage(named: bgImageName), forState: UIControlState.Normal)
        
        setBackgroundImage(UIImage(named: bgImageName + "_highlighted"), forState: UIControlState.Highlighted)
        
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        
        setTitle(title, forState: UIControlState.Normal)
        
        setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
        
        titleLabel?.font = UIFont.systemFontOfSize(font)
    }
}
